package com.ucn.groupawesome.archgame;

import java.util.ArrayList;

public class IdeaManager
{
	static IdeaManager instance;
	ArrayList<Idea> listIdea;

	public IdeaManager()
	{
		listIdea = new ArrayList<Idea>();
	}

	public Idea createIdea()
	{
		int nextNum = listIdea.isEmpty() ? 1 : listIdea.size() + 1;

		Idea idea = new Idea(nextNum);
		listIdea.add(idea);

		return idea;
	}

	public Idea getLastIdea()
	{
		if (!listIdea.isEmpty())
		{
			return listIdea.get(listIdea.size() - 1);
		}

		return null;
	}

	public static IdeaManager getInstance()
	{
		if (instance == null)
		{
			instance = new IdeaManager();
		}

		return instance;
	}
}
